#! /usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023-04-20 21:58
# @Author  : wsh
# @File    : depart_params.py

from typing import Optional
from pydantic import BaseModel, Field


class DepartInfoParam(BaseModel):
    depart_name: str = Field(..., max_length=50, title="部门名称")
    depart_rank: int = Field(..., title="部门等级")
    belong_depart_id: int = Field(..., title="隶属部门ID")
    remark: Optional[str] = Field(default="", title="备注")
    company_id: int = Field(..., title="隶属公司ID")


class DepartGetIdParam(BaseModel):
    depart_name: str = Field(..., max_length=50, title="部门名称")
    company_id: int = Field(..., title="隶属公司ID")


class DepartListItemPara(BaseModel):
    depart_id: int = Field(..., title="部门ID")
    depart_name: str = Field(..., max_length=50, title="部门名称")


class UpdateDepartParam(BaseModel):
    add: list = Field(title="添加部门", default=[
        {'depart_name': '##', "Remark": '#', 'company_id': '#'}])
    delete: list = Field(title="删除公司", default=[{"depart_id": 1}])
    update: list = Field(title="修改公司",
                         default=[{"depart_id": 1}])
